from system_app.models import check_task

# 添加任务数据
def addCheckTask(data):
    res = check_task.objects.create(**data)
    return res


# 根据uuid查询
def getCheckTaskByUuid(uuid):
    res = check_task.objects.filter(uuid=uuid).first()
    return res


# 根据user_uuid查询
def getCheckTaskByUserUuid(user_uuid):
    res = check_task.objects.filter(user_uuid=user_uuid)
    return res


# 获取检测任务的视频列表
def getCheckVideoList():
    res = check_task.objects.all()
    return res


# 根据检测任务uuid，更新video_state
def updateVideoState(uuid, video_state):

    res = check_task.objects.filter(uuid=uuid).update(video_state=video_state)
    return res
